<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/*
<span class='line'>  2</span>  * Settings.js
<span class='line'>  3</span>  * 
<span class='line'>  4</span>  * Copyright (c) 2011, OSBI Ltd. All rights reserved.
<span class='line'>  5</span>  *
<span class='line'>  6</span>  * This library is free software; you can redistribute it and/or
<span class='line'>  7</span>  * modify it under the terms of the GNU Lesser General Public
<span class='line'>  8</span>  * License as published by the Free Software Foundation; either
<span class='line'>  9</span>  * version 2.1 of the License, or (at your option) any later version.
<span class='line'> 10</span>  *
<span class='line'> 11</span>  * This library is distributed in the hope that it will be useful,
<span class='line'> 12</span>  * but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class='line'> 13</span>  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
<span class='line'> 14</span>  * Lesser General Public License for more details.
<span class='line'> 15</span>  *
<span class='line'> 16</span>  * You should have received a copy of the GNU Lesser General Public
<span class='line'> 17</span>  * License along with this library; if not, write to the Free Software
<span class='line'> 18</span>  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
<span class='line'> 19</span>  * MA 02110-1301  USA
<span class='line'> 20</span>  */</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="COMM">/**
<span class='line'> 22</span>  * Change settings here
<span class='line'> 23</span>  */</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">Settings</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT">    </span><span class="NAME">VERSION</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Saiku 2.3"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT">    </span><span class="NAME">BIPLUGIN</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT">    </span><span class="NAME">BASE_URL</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT">    </span><span class="NAME">TOMCAT_WEBAPP</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"/saiku"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT">    </span><span class="NAME">REST_MOUNT_POINT</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"/rest/saiku/"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT">    </span><span class="NAME">DIMENSION_PREFETCH</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT">    </span><span class="NAME">ERROR_LOGGING</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT">    </span><span class="NAME">QUERY_PROPERTIES</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT">        </span><span class="STRN">'saiku.olap.query.automatic_execution'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'true'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT">        </span><span class="STRN">'saiku.olap.query.nonempty'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'true'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT">        </span><span class="STRN">'saiku.olap.query.nonempty.rows'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'true'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT">        </span><span class="STRN">'saiku.olap.query.nonempty.columns'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'true'</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT">    </span><span class="NAME">PLUGINS</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT">        </span><span class="STRN">"Chart"</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT">    </span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT">    </span><span class="NAME">TELEMETRY_SERVER</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'http://telemetry.analytical-labs.com:7000'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT">    </span><span class="NAME">LOCALSTORAGE_EXPIRATION</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="COMM">/* 10 hours, in ms */</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 44</span> 
<span class='line'> 45</span> </span><span class="COMM">/**
<span class='line'> 46</span>  * Extend settings with query parameters
<span class='line'> 47</span>  */</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="NAME">Settings.GET</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">qs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.location.search</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT">    </span><span class="NAME">qs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">qs.split</span><span class="PUNC">(</span><span class="STRN">"+"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">join</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">        </span><span class="NAME">tokens</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT">        </span><span class="NAME">re</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/[?&]?([^=]+)=([^&]*)/g</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 54</span> 
<span class='line'> 55</span> </span><span class="WHIT">    </span><span class="KEYW">while</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tokens</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">re.exec</span><span class="PUNC">(</span><span class="NAME">qs</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">decodeURIComponent</span><span class="PUNC">(</span><span class="NAME">tokens</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">isNaN</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"true"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT">        </span><span class="NAME">params</span><span class="PUNC">[</span><span class="NAME">decodeURIComponent</span><span class="PUNC">(</span><span class="NAME">tokens</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toUpperCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT">            </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 63</span> 
<span class='line'> 64</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="NAME">_.extend</span><span class="PUNC">(</span><span class="NAME">Settings</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Settings.GET</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 67</span> 
<span class='line'> 68</span> </span><span class="NAME">Settings.REST_URL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Settings.BASE_URL</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT">    </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">Settings.TOMCAT_WEBAPP</span><span class="WHIT"> 
<span class='line'> 70</span>     </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">Settings.REST_MOUNT_POINT</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 71</span> 
<span class='line'> 72</span> 
<span class='line'> 73</span> </span><span class="COMM">/**
<span class='line'> 74</span>  * &lt; IE9 doesn't support Array.indexOf
<span class='line'> 75</span>  */</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">Array.prototype.indexOf</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT">  </span><span class="NAME">Array.prototype.indexOf</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">elt</span><span class="WHIT"> </span><span class="COMM">/*, from*/</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.length</span><span class="WHIT"> </span><span class="PUNC">>>></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 81</span> 
<span class='line'> 82</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Number</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT">    </span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT">         </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">Math.ceil</span><span class="PUNC">(</span><span class="NAME">from</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT">         </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Math.floor</span><span class="PUNC">(</span><span class="NAME">from</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">      </span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 88</span> 
<span class='line'> 89</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">from</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT">          </span><span class="KEYW">this</span><span class="PUNC">[</span><span class="NAME">from</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">elt</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 98</span> 
<span class='line'> 99</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.location.hostname</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.location.hostname</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"dev.analytical-labs.com"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">window.location.hostname</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"demo.analytical-labs.com"</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT">    </span><span class="NAME">Settings.USERNAME</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"admin"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT">    </span><span class="NAME">Settings.PASSWORD</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"admin"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>102</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>103</span> </span></pre></body></html>